﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Controls.Common="clr-namespace:Imagin.Controls.Common;assembly=Imagin.Controls.Common">
    <Style x:Key="Style.ToggleSwitch.Thumb" TargetType="Thumb">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Background" Value="{DynamicResource Brush.CheckBox.Switch.Thumb.Background}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.CheckBox.Switch.Thumb.Border}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="Width" Value="20"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type Controls.Common:ToggleSwitch}" TargetType="{x:Type Controls.Common:ToggleSwitch}">
        <Setter Property="Background" Value="{DynamicResource Brush.CheckBox.Switch.Background}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.CheckBox.Switch.Border}"/>
        <Setter Property="Foreground" Value="{DynamicResource Brush.CheckBox.Switch.Foreground}"/>
        <Setter Property="ThumbStyle" Value="{StaticResource Style.ToggleSwitch.Thumb}"/>
        <Style.Triggers>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.CheckBox.Switch.Checked.Background}" />
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.CheckBox.Switch.Checked.Border}" />
                <Setter Property="Foreground" Value="{DynamicResource Brush.CheckBox.Switch.Checked.Foreground}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="{StaticResource DisabledOpacity}" />
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>